# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from ragendja.urlsauto import urlpatterns
from ragendja.auth.urls import urlpatterns as auth_patterns
from myapp.forms import UserRegistrationForm
from django.contrib import admin
from django.conf import settings
import os
admin.autodiscover()

from main.models import Series, Episode, Comment
from django.contrib.auth.models import User
from main.admin import SeriesAdmin, EpisodeAdmin, CommentAdmin, UserAdmin
admin.site.register(Series, SeriesAdmin)
admin.site.register(Episode, EpisodeAdmin)
admin.site.register(Comment, CommentAdmin)
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
handler500 = 'ragendja.views.server_error'

urlpatterns = auth_patterns + patterns('',
    ('^admin/(.*)', admin.site.root),
    (r'^', include('main.urls')),
    (r'^main/$', 'django.views.generic.simple.direct_to_template',
        {'template': 'main.html'}),
#    # Override the default registration form
#    url(r'^account/register/$', 'registration.views.register',
#        kwargs={'form_class': UserRegistrationForm},
#        name='registration_register'),
) + urlpatterns
